package com.sena.engine.snmp.enums;

import com.sena.engine.enums.SnmpResultCodeEnum;
import org.apache.commons.lang3.StringUtils;

public enum PortTypeEnums {

    /**
     *
     */
    ETHERNET_CSMACD("ETHERNET_CSMACD", 6),
    /**
     *
     */
    ISO88023CSMACD("ISO88023CSMACD", 7),
    /**
     *
     */
    GIGABITETHERNET("GIGABITETHERNET ", 117),
    /**
     * fastEntherenet
     */
    FASTENTHERNET("FASTENTHERNET", 62),
    /**
     * 无线ap
     */
    IEEE80211("IEEE80211", 71);


    /**
     * 描述
     */
    private String description = null;

    /**
     * code值
     */
    private int code;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    PortTypeEnums(String description, int code) {
        this.description = description;
        this.code = code;
    }

    /**
     * 通过枚举<code>code</code>获得枚举
     *
     * @param code
     * @return
     */
    public static PortTypeEnums getByCode(int code) {
        if (code == 0) {
            return null;
        }
        for (PortTypeEnums result : values()) {
            if (result.code == code) {
                return result;
            }
        }
        return null;
    }
}
